import { createI18n } from "vue-i18n";

import en from "./en";
import zh from "./zh";

const savedLang = localStorage.getItem("language");
const lang = savedLang || "zh_CN";

const i18n = createI18n({
	legacy: false, // 使用 Composition API 模式
	locale: lang,
	messages: {
		en_US: en,
		zh_CN: zh
	}
});

export default i18n;
